﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package VisitingCenter {
    import Classes.*;

    public class StatsManagerVisitorCenter {

        private static var m_num_residences:int;
        private static var m_num_businesses:int;
        private static var m_num_landmarks:int;
        private static var m_num_municipals:int;
        private static var m_num_farmPlots:int;
        private static var m_num_empty_franchise:int;
        private static var m_area:int;
        private static var m_roads:int;
        private static var m_market_value:Number;
        private static var m_wilderness:Number;
        private static var initialized:Boolean = false;

        public static function get residences():int{
            return (m_num_residences);
        }
        public static function get businesses():String{
            return ((m_num_businesses + ""));
        }
        public static function get landmarks():String{
            return ((m_num_landmarks + ""));
        }
        public static function get municipals():String{
            return ((m_num_municipals + ""));
        }
        public static function get farmPlots():String{
            return ((m_num_farmPlots + ""));
        }
        public static function get empty_franchise():String{
            return ((m_num_empty_franchise + ""));
        }
        public static function get area():int{
            return (m_area);
        }
        public static function get wilderness():String{
            return ((m_wilderness + ""));
        }
        public static function get roads():int{
            return (m_roads);
        }
        public static function get marketValue():String{
            return ((m_market_value + ""));
        }
        public static function generateData():void{
            var _local2:ItemInstance;
            m_num_residences = 0;
            m_num_businesses = 0;
            m_num_landmarks = 0;
            m_num_municipals = 0;
            m_num_farmPlots = 0;
            m_num_empty_franchise = 0;
            m_area = 0;
            m_roads = 0;
            m_market_value = 0;
            m_wilderness = 0;
            initialized = true;
            var _local1:Array = Global.world.getObjects();
            for each (_local2 in _local1) {
                if ((_local2 is Residence)){
                    m_num_residences++;
                } else {
                    if ((_local2 is Business)){
                        m_num_businesses++;
                    } else {
                        if ((_local2 is Landmark)){
                            m_num_landmarks++;
                        } else {
                            if ((_local2 is Municipal)){
                                m_num_municipals++;
                            } else {
                                if (_local2.getItem().type == "plot"){
                                    m_num_farmPlots++;
                                } else {
                                    if ((_local2 is LotSite)){
                                        m_num_empty_franchise++;
                                    } else {
                                        if ((_local2 is Wilderness)){
                                            m_wilderness++;
                                        } else {
                                            if ((_local2 is Road)){
                                                m_roads++;
                                            };
                                        };
                                    };
                                };
                            };
                        };
                    };
                };
                if ((((((((((((_local2 is Residence)) || ((_local2 is Business)))) || ((_local2 is Landmark)))) || ((_local2 is Municipal)))) || ((_local2 is Plot)))) || ((_local2 is LotSite)))){
                    m_area = (m_area + (_local2.getSize().x * _local2.getSize().y));
                    m_market_value = (m_market_value + ((_local2 as MapResource).getItem().cost as Number));
                    m_market_value = (m_market_value + (((_local2 as MapResource).getItem().cash as Number) * 200));
                };
            };
        }

    }
}//package VisitingCenter 
